package com.dzsw.order.feign;

import com.dzsw.order.fallback.ItemServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Map;

@FeignClient(value = "app-item", fallback = ItemServiceFallback.class)
public interface ItemFeignClient {

    /**
     * 这里定义了类似于SpringMVC用法的方法，就可以进行RESTful方式的调用了
     *
     * @param id
     * @return
     */
    @RequestMapping(value = "/item/query/{id}", method = RequestMethod.GET)
    Map<String, Object> queryItemById(@PathVariable("id") Long id);

}
